import axios from '@/libs/api.request'
import {getFullUrl} from "../config";

let getUrl = getFullUrl('user');

//--------------------------------------GET
// 获取所有功能
export const listFunction = () => {
  return axios.request({
    url: getUrl('/function'),
    method: 'GET'
  })
}


//--------------------------------------POST
// 添加功能
export const addFunction = (functionForm) => {
  return axios.request({
    url: getUrl('/function'),
    method: 'POST',
    data: functionForm
  })
}

//--------------------------------------PUT
// 更新功能
export const updateFunction = (functionForm) => {
  return axios.request({
    url: getUrl('/function'),
    method: 'PUT',
    data: functionForm
  })
}


//--------------------------------------DELETE
// 更新功能
export const removeFunction = (functionId) => {
  return axios.request({
    url: getUrl('/function/' + functionId),
    method: 'DELETE'
  })
}

